package com.runfast.waimai.dao.model;

import com.fasterxml.jackson.annotation.JsonIgnore;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.Date;

public class RunfastGallery implements Serializable {

    /**新增*/
    public interface Insert {
    }
    /**修改*/
    public interface Modify {
    }

    @Null(message = "传入参数错误", groups = {Insert.class})
    @NotNull(message = "图库ID错误", groups = {Modify.class})
    private Integer id;

    /**
     * 标题
     */
    private String title;

    /**
     * 描述
     */
    @Size(min = 1, max = 255, message = "图像描述错误", groups = {Insert.class, Modify.class})
    private String depiction;

    /**
     * 缩略图
     */
    private String thumbnail;

    /**
     * 原图
     */
    @Size(min = 1, max = 128, message = "图像地址错误", groups = {Insert.class, Modify.class})
    private String original;

    /**
     * 图库类别
     */
    @NotNull(message = "图库分类参数错误", groups = {Insert.class, Modify.class})
    @Min(value = 1, message =  "图库分类参数错误", groups = {Insert.class, Modify.class})
    private Integer categoryid;

    /**
     * 是否展示 0:不展示  1:展示
     */
    @JsonIgnore
    private Boolean enable;

    /**
     * 创建时间
     */
    @Null(message = "传入参数错误", groups = {Insert.class, Modify.class})
    private Date createtime;

    /**
     * 删除状态  0：未删除   1：已删除
     */
    private Boolean del;

    private static final long serialVersionUID = 1L;

    public Integer getId() {
        return id;
    }

    public RunfastGallery withId(Integer id) {
        this.setId(id);
        return this;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public RunfastGallery withTitle(String title) {
        this.setTitle(title);
        return this;
    }

    public void setTitle(String title) {
        this.title = title == null ? null : title.trim();
    }

    public String getDepiction() {
        return depiction;
    }

    public RunfastGallery withDepiction(String depiction) {
        this.setDepiction(depiction);
        return this;
    }

    public void setDepiction(String depiction) {
        this.depiction = depiction == null ? null : depiction.trim();
    }

    public String getThumbnail() {
        return thumbnail;
    }

    public RunfastGallery withThumbnail(String thumbnail) {
        this.setThumbnail(thumbnail);
        return this;
    }

    public void setThumbnail(String thumbnail) {
        this.thumbnail = thumbnail == null ? null : thumbnail.trim();
    }

    public String getOriginal() {
        return original;
    }

    public RunfastGallery withOriginal(String original) {
        this.setOriginal(original);
        return this;
    }

    public void setOriginal(String original) {
        this.original = original == null ? null : original.trim();
    }

    public Integer getCategoryid() {
        return categoryid;
    }

    public RunfastGallery withCategoryid(Integer categoryid) {
        this.setCategoryid(categoryid);
        return this;
    }

    public void setCategoryid(Integer categoryid) {
        this.categoryid = categoryid;
    }

    public Boolean getEnable() {
        return enable;
    }

    public RunfastGallery withEnable(Boolean enable) {
        this.setEnable(enable);
        return this;
    }

    public void setEnable(Boolean enable) {
        this.enable = enable;
    }

    public Date getCreatetime() {
        return createtime;
    }

    public RunfastGallery withCreatetime(Date createtime) {
        this.setCreatetime(createtime);
        return this;
    }

    public void setCreatetime(Date createtime) {
        this.createtime = createtime;
    }

    public Boolean getDel() {
        return del;
    }

    public RunfastGallery withDel(Boolean del) {
        this.setDel(del);
        return this;
    }

    public void setDel(Boolean del) {
        this.del = del;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", title=").append(title);
        sb.append(", depiction=").append(depiction);
        sb.append(", thumbnail=").append(thumbnail);
        sb.append(", original=").append(original);
        sb.append(", categoryid=").append(categoryid);
        sb.append(", enable=").append(enable);
        sb.append(", createtime=").append(createtime);
        sb.append(", del=").append(del);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}